package nl.weeaboo.sh.model;

import timon.common.xml.XmlElement;

public final class TileSetIndex {

	private final TileSetModel tileSet;
	private final int x, y;
	
	public TileSetIndex(TileSetModel tileSet, int x, int y) {
		this.tileSet = tileSet;		
		this.x = x;
		this.y = y;
	}
	
	//Functions
	public TileSetIndex clone() {
		return new TileSetIndex(getTileSet(), x, y);
	}
	
	//Getters
	public TileSetModel getTileSet() { return tileSet; }
	public int getX() { return x; }
	public int getY() { return y; }
	
	//Setters
	
	//Save Support
	public void saveInto(XmlElement e) {
		e.addChild("tileSet", tileSet.getId());
		e.addChild("x", x);
		e.addChild("y", y);
	}
	
}
